﻿using System;
using System.Collections.Generic;

using System.Text;
using System.IO;

namespace ShapeMergeFactory
{
   internal class ShapeFileRecord
    {
        private int recordNumber;
        public ShapeFileRecordHead shapeRecordHead
        {
            get;
            private set;
        }
        public ShapeFileRecord()
        {
            recordNumber = 1;
            shapeRecordHead = new ShapeFileRecordHead();
        }

        public void AddRecord(ShapeBinaryReader shapeBinaryReader,ShapeBinaryWriter shapeBinaryWriter)
        {
            shapeRecordHead.ReadRecordHeard(shapeBinaryReader);
            shapeRecordHead.recordNumber = this.recordNumber;
            shapeRecordHead.WriteRecordHeard(shapeBinaryWriter);
            ++recordNumber;
            for (int i = 0; i < shapeRecordHead.recordLength/2; i++)
            {
                shapeBinaryWriter.Write(shapeBinaryReader.ReadInt32());
            }
        }
    }
}
